package com.yang.jdbc;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.Statement;

/**
 * @author yangjiming
 * @create 2021-03-26 19:00
 */
public class DeleteMysql {
    public static void main(String[] args) throws Exception {
        Class.forName("com.mysql.jdbc.Driver");

        String url="jdbc:mysql://master:3306/shujia";
        String username="root";
        String password="123456";
        Connection conn = DriverManager.getConnection(url,username,password);

        Statement statement = conn.createStatement();
        //delete from student where name='test1'
        String sql = "delete from student where name='test1'";
        statement.executeUpdate(sql);

        statement.close();
        conn.close();

    }
}
